package com.stu.dcxy.design.creatation.prototype;

import lombok.Data;

import java.io.Serializable;

/**
 * @Classname User
 * @Version 1.0.0
 * @Date 2022/3/30 16:33
 * @Created by yd
 */
@Data
public class User implements Cloneable, Serializable {
    private String username;
    private Integer age;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        User user = new User();
        user.setUsername(this.username);
        user.setAge(this.age);
        return user;
    }
}
